package com.it.Demo1;

public class Rectangle {
    public int length;
    public int width;
    public Rectangle(int l, int w){
        this.length=l;
        this.width=w;
    }
    public int getArea(){
        return length*width;
    }
    public int getPer(){
        return (length+width)*2;
    }
    public void showAll(){
        System.out.print("长:");
        System.out.println(length);
        System.out.print("宽:");
        System.out.println(width);
        System.out.print("面积:");
        System.out.println(getArea());
        System.out.print("周长:");
        System.out.println(getPer());
    }
    public static void main(String[] args){
        Rectangle rectangle=new Rectangle(10,12);
        rectangle.showAll();


    }


}
